<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<h1>JavaScript Example 6</h1>
<br>
Shows how to control while loops with strings<br>
<br>
<hr>
<br>

<!-- SCRIPT STARTS HERE -->

<script type="text/javascript">
	// declare a variable
	var value;
	// use string value in while condition !
	while(!value) {
		value = window.prompt("Enter a message:");
		if (!value) document.write("You must enter a message!<br>");
	}
	// a (non empty) value has been supplied, so we can continue	
	document.write("The message is:<strong>\"");
	document.write(value);
	document.writeln("\"</strong>");
</script>

<!-- SCRIPT ENDS HERE -->

</body>
</html>
